<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>

    var xhr = new XMLHttpRequest()
    xhr.open('GET', 'add.php')
    xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    xhr.send('key1=value')
    xhr.onreadystatechange = function () {
      console.log(this.responseText)
    }

  </script>
</body>
</html>
